#pragma once

#include<iostream>
#include<functional>
#include<string>
#include<sstream>

class Task
{
public:
    Task()
    {}
    Task(int x , int y):a(x), b(y)
    {}
    void Excute()
    {
        result = a+b;
    }
    //仿函数
    void operator()()
    {
        Excute();
    }
    //获取整个过程的政府穿
    std::string Result2String()
    {
        std::stringstream ss;
        ss << a <<'+' <<b <<'=' <<result <<std::endl;
        return ss.str();
    }
private:
    //将参数作为成员变量，一定程度上可以进行解耦
    int a;
    int b;
    int result;
};